<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
    <title>Bootstrap 4的新布局——弹性盒子</title>
    <!--    Bootstrap核心css文件-->
    <link rel="stylesheet" href="https://cdn.bootcss.com/twitter-bootstrap/4.4.1/css/bootstrap.min.css">
</head>
<body class="container">
<h5>align-content-start</h5>

<div class="d-flex align-content-start bg-warning text-white flex-wrap mb-4" style="height: 150px">
    <div class="p-2 bg-primary">Flex 项目1</div>
    <div class="p-2 bg-success">Flex 项目2</div>
    <div class="p-2 bg-danger">Flex 项目3</div>
    <div class="p-2 bg-primary">Flex 项目4</div>
    <div class="p-2 bg-success">Flex 项目5</div>
    <div class="p-2 bg-danger">Flex 项目6</div>
    <div class="p-2 bg-primary">Flex 项目7</div>
    <div class="p-2 bg-success">Flex 项目8</div>
    <div class="p-2 bg-danger">Flex 项目9</div>
    <div class="p-2 bg-primary">Flex 项目10</div>
    <div class="p-2 bg-success">Flex 项目11</div>
    <div class="p-2 bg-danger">Flex 项目12</div>
</div>
<h5>align-content-center</h5>

<div class="d-flex align-content-center bg-warning text-white flex-wrap mb-4" style="height: 150px">
    <div class="p-2 bg-primary">Flex 项目1</div>
    <div class="p-2 bg-success">Flex 项目2</div>
    <div class="p-2 bg-danger">Flex 项目3</div>
    <div class="p-2 bg-primary">Flex 项目4</div>
    <div class="p-2 bg-success">Flex 项目5</div>
    <div class="p-2 bg-danger">Flex 项目6</div>
    <div class="p-2 bg-primary">Flex 项目7</div>
    <div class="p-2 bg-success">Flex 项目8</div>
    <div class="p-2 bg-danger">Flex 项目9</div>
    <div class="p-2 bg-primary">Flex 项目10</div>
    <div class="p-2 bg-success">Flex 项目11</div>
    <div class="p-2 bg-danger">Flex 项目12</div>
</div>
<h5>align-content-end</h5>

<div class="d-flex align-content-end bg-warning text-white flex-wrap mb-4" style="height: 150px">
    <div class="p-2 bg-primary">Flex 项目1</div>
    <div class="p-2 bg-success">Flex 项目2</div>
    <div class="p-2 bg-danger">Flex 项目3</div>
    <div class="p-2 bg-primary">Flex 项目4</div>
    <div class="p-2 bg-success">Flex 项目5</div>
    <div class="p-2 bg-danger">Flex 项目6</div>
    <div class="p-2 bg-primary">Flex 项目7</div>
    <div class="p-2 bg-success">Flex 项目8</div>
    <div class="p-2 bg-danger">Flex 项目9</div>
    <div class="p-2 bg-primary">Flex 项目10</div>
    <div class="p-2 bg-success">Flex 项目11</div>
    <div class="p-2 bg-danger">Flex 项目12</div>
</div>
<h5>align-content-between</h5>

<div class="d-flex align-content-between bg-warning text-white flex-wrap mb-4" style="height: 150px">
    <div class="p-2 bg-primary">Flex 项目1</div>
    <div class="p-2 bg-success">Flex 项目2</div>
    <div class="p-2 bg-danger">Flex 项目3</div>
    <div class="p-2 bg-primary">Flex 项目4</div>
    <div class="p-2 bg-success">Flex 项目5</div>
    <div class="p-2 bg-danger">Flex 项目6</div>
    <div class="p-2 bg-primary">Flex 项目7</div>
    <div class="p-2 bg-success">Flex 项目8</div>
    <div class="p-2 bg-danger">Flex 项目9</div>
    <div class="p-2 bg-primary">Flex 项目10</div>
    <div class="p-2 bg-success">Flex 项目11</div>
    <div class="p-2 bg-danger">Flex 项目12</div>
</div>
<h5>align-content-around</h5>

<div class="d-flex align-content-around bg-warning text-white flex-wrap mb-4" style="height: 150px">
    <div class="p-2 bg-primary">Flex 项目1</div>
    <div class="p-2 bg-success">Flex 项目2</div>
    <div class="p-2 bg-danger">Flex 项目3</div>
    <div class="p-2 bg-primary">Flex 项目4</div>
    <div class="p-2 bg-success">Flex 项目5</div>
    <div class="p-2 bg-danger">Flex 项目6</div>
    <div class="p-2 bg-primary">Flex 项目7</div>
    <div class="p-2 bg-success">Flex 项目8</div>
    <div class="p-2 bg-danger">Flex 项目9</div>
    <div class="p-2 bg-primary">Flex 项目10</div>
    <div class="p-2 bg-success">Flex 项目11</div>
    <div class="p-2 bg-danger">Flex 项目12</div>
</div>
<h5>align-content-stretch</h5>

<div class="d-flex align-content-stretch bg-warning text-white flex-wrap mb-4" style="height: 150px">
    <div class="p-2 bg-primary">Flex 项目1</div>
    <div class="p-2 bg-success">Flex 项目2</div>
    <div class="p-2 bg-danger">Flex 项目3</div>
    <div class="p-2 bg-primary">Flex 项目4</div>
    <div class="p-2 bg-success">Flex 项目5</div>
    <div class="p-2 bg-danger">Flex 项目6</div>
    <div class="p-2 bg-primary">Flex 项目7</div>
    <div class="p-2 bg-success">Flex 项目8</div>
    <div class="p-2 bg-danger">Flex 项目9</div>
    <div class="p-2 bg-primary">Flex 项目10</div>
    <div class="p-2 bg-success">Flex 项目11</div>
    <div class="p-2 bg-danger">Flex 项目12</div>
</div>
<!--引入js文件-->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"></script>
<!--Bootstrap核心JavaScript文件-->
<script src="https://cdn.bootcss.com/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script>
</body>
</html>